Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix regression theme(legend.direction) #5508

Merged
merged 3 commits into from
Nov 27, 2023

Conversation

teunbrand
Copy link
Collaborator

In current main branch, the guides do not respond to theme(legend.direction).

devtools::load_all("~/packages/ggplot2")
#> ℹ Loading ggplot2

ggplot(mpg, aes(displ, hwy, shape = factor(cyl), colour = cty)) +
  geom_point() +
  theme(legend.direction = "horizontal")

Created on 2023-11-03 with reprex v2.0.2

With this PR, they respond again to that setting:

devtools::load_all("~/packages/ggplot2")
#> ℹ Loading ggplot2

ggplot(mpg, aes(displ, hwy, shape = factor(cyl), colour = cty)) +
  geom_point() +
  theme(legend.direction = "horizontal")

Created on 2023-11-03 with reprex v2.0.2

Because I was surprised that this setting isn't tested for anywhere, I've added two visual tests.

@teunbrand teunbrand added this to the ggplot2 3.5.0 milestone Nov 3, 2023
Copy link
Member

@thomasp85 thomasp85 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@teunbrand teunbrand merged commit 44c2497 into tidyverse:main Nov 27, 2023
12 checks passed
@teunbrand teunbrand deleted the legend_direction branch November 27, 2023 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants